package com.supinfo.youfood.pages.magasin.add;

import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.LoadableDetachableModel;

import com.supinfo.food.entities.Magasin;
import com.supinfo.youfood.forms.AddMagasinForm;
import com.supinfo.youfood.template.Template;

/**
 * Ajout d'un magasin
 * @author Keitaro
 */
public class MagasinAdd extends Template {
	
	public MagasinAdd() {
		formManager();
	}

	/**
	 * Gestion du formulaire
	 */
	@SuppressWarnings("rawtypes")
	private void	formManager() {
		Form form = new AddMagasinForm("addMagasinForm", new CompoundPropertyModel(new LoadableDetachableModel() {
			private static final long serialVersionUID = 1L;
			@Override
			protected Object load() {
				return new Magasin();
			}
		}));
		add(form);
	}
}
